home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Caml Light 0.61 / Source / src / lex / scanner.mll < prev    next >
Encoding:
Text File  |  1993-09-24  |  3.0 KB  |  23 lines  |  [TEXT/MPS ]

  1. (* The lexical analyzer for lexer definitions. Bootstrapped! *)
  2.  
  3. {
  4. #open "syntax";;
  5. #open "grammar";;
  6. #open "scan_aux";;
  7. }
  8.  
  9. rule main = parse
  10.     [` ` `\010` `\013` `\009` ] + 
  11.     { main lexbuf }
  12.   | "(*" 
  13.     { comment_depth := 1;
  14.       comment lexbuf;
  15.       main lexbuf }
  16.   | ([`A`-`Z` `a`-`z`] | `_` [`A`-`Z` `a`-`z` `'` `0`-`9`])
  17.     ( `_` ? [`A`-`Z` `a`-`z` `'` `0`-`9`] ) * 
  18.     { match get_lexeme lexbuf with
  19.         "rule" -> Trule
  20.       | "parse" -> Tparse
  21.       | "and" -> Tand
  22.       | "eof" -> Teof
  23.